package service;

import common.Message;
import common.MessageType;

import java.io.ObjectOutputStream;
import java.net.Socket;

public class GetCourse extends Thread{
    private String userid;
    private Socket socket;
    private ObjectOutputStream oos;
    public GetCourse(String userid, Socket socket){
        this.userid=userid;
        this.socket=socket;

    }
    @Override
    public void run(){
        Message ms=new Message();
        ms.setState(MessageType.get_Course);
        while(true){
            try {
                oos=new ObjectOutputStream(socket.getOutputStream());
                oos.writeObject(ms);
                sleep(5000);
            } catch (Exception e) {
                System.out.println("GetCourse线程异常2");
                break;
            }
        }
    }
}
